package com.ssh.dao;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.ssh.model.Information;


public class InformationDao extends HibernateDaoSupport implements IInformationDao{
	/* (non-Javadoc)
	 * @see com.ssh.dao.IInformationDao#save(com.ssh.model.Information)
	 */
	@Override
	public void save(Information i) {
		try {
			getHibernateTemplate().save(i);
		} catch (RuntimeException re) {
			throw re;
		}
	}
	
	/* (non-Javadoc)
	 * @see com.ssh.dao.IInformationDao#findById(java.lang.Integer)
	 */
	@Override
	public Information findById(java.lang.Integer id) {
		try {
			Information c = (Information) getHibernateTemplate().get(
					"com.ssh.model.Information", id);
			return c;
		} catch (RuntimeException re) {
			throw re;
		}
	}
	
	/* (non-Javadoc)
	 * @see com.ssh.dao.IInformationDao#attachDirty(com.ssh.model.Information)
	 */
	@Override
	public void attachDirty(Information i) {
		try {
			getHibernateTemplate().saveOrUpdate(i);
		} catch (RuntimeException re) {
			throw re;
		}
	}

	@Override
	public IInformationDao getInformationDao() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void setInformationDao(IInformationDao informationDao) {
		// TODO Auto-generated method stub
		
	}

}
